package com.ce.study.procum;

public class ConsumerRunnable implements Runnable {
	private GoodsStock goodsStock;
	private String name;
	public ConsumerRunnable(GoodsStock goodsStock, String name) {
		this.name = name;
		this.goodsStock = goodsStock;
	}

	public void run() {
		while(true) {
			try {
				goodsStock.getGoods();
				System.out.println("consume name:"+name);
				Thread.sleep(100);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

}
